package com.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.base.BaseServiceImpl;
import com.entity.ArticalChannel;
import com.exception.ServiceException;
import com.repository.ArticalChannelRepository;
import com.service.ArticalChannelService;
import com.util.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.util.Date;

@Service
public class ArticalChannelServiceImpl extends BaseServiceImpl<ArticalChannel,ArticalChannel, ArticalChannelRepository,ArticalChannel> implements ArticalChannelService {
    @Autowired
    private ArticalChannelRepository articalChannelRepository;
    @Override
    public Integer todayCounts(Integer channelId) {
        QueryWrapper<ArticalChannel> wrapper = new QueryWrapper<>();
        if(StringUtils.isEmpty(channelId)){
            throw new ServiceException("请传入频道id");
        }


        int count = articalChannelRepository.todayCounts(channelId);
        return count;
    }
}
